package com.tushen.labor.bean;

//TODO 天气枚举不够,当前只给了3个天气切图
public enum Weather {

    QINGTIAN("晴","00"),

    DUOYUN("多云","01"),
    YINTIAN("阴","02"),

    ZHENYUN("阵雨","03"),

    LEIZHENYUN("雷阵雨","04"),

    LEIZHENYUNBING("雷阵雨伴有冰雹","05"),

    YUJIAXUE("雨夹雪","06"),

    XIAOYU("小雨","07"),

    ZHONGYU("中雨","08"),

    DAYU("大雨","09"),

    BAOYU("暴雨","10"),

    DABAOYU("大暴雨","11"),

    TEDABAOYU("特大暴雨","12"),

    ZHENXUE("阵雪","13"),

    XIAOXUE("小雪","14"),

    ZHONGXUE("中雪","15"),

    DAXUE("大雪","16"),

    BAOXUE("暴雪","17"),

    WU("雾","18"),

    DONGYUE("冻雨","19"),

    SHACHENBAO("沙尘暴","20"),

    XIAODAOZHONGYU("小到中雨","21"),

    ZHONGDAODAYUE("中到大雨","22"),

    DADAOBAOYU("大到暴雨","23"),

    BAOYUDAODABAOYU("暴雨到大暴雨","24"),

    BAOYUDAOTEDABAOYU("大暴雨到特大暴雨","25"),

    XIAODAOZHONGXUE("小到中雪","26"),

    ZHONGDAODAXUE("中到大雪","27"),

    DADAOBAOXUE("大到暴雪","28"),

    FUCHEN("浮尘","29"),

    YANGSHA("扬沙","30"),

    QIANGSHACHENBAO("强沙尘暴","31"),

    MAI("霾","53");

    private final String desc;

    private final String code;

    private Weather(String desc,String code) {
        this.desc = desc;
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static Weather matchCode(String code) {
        Weather result = null;
        for (Weather city : values()) {
            if (city.getCode().equals(code)) {
                result = city;
                break;
            }
        }
        return result;
    }



}